home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.5 / Examples / Printer / HP_DeskJet_CMYK / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-30  |  1.5 KB  |  72 lines

  1. /*
  2.  * $Id: init.c 44.2 1999/09/16 09:18:27 olsen Exp olsen $
  3.  *
  4.  * :ts=4
  5.  *
  6.  * COPYRIGHT:
  7.  *
  8.  *   Unless otherwise noted, all files are Copyright (c) 1999 Amiga, Inc.
  9.  *   All rights reserved.
  10.  *
  11.  * DISCLAIMER:
  12.  *
  13.  *   This software is provided "as is". No representations or warranties
  14.  *   are made with respect to the accuracy, reliability, performance,
  15.  *   currentness, or operation of this software, and all use is at your
  16.  *   own risk. Neither Amiga nor the authors assume any responsibility
  17.  *   or liability whatsoever with respect to your use of this software.
  18.  *
  19.  */
  20.  
  21. #include "global.h"
  22.  
  23. /****************************************************************************/
  24.  
  25. VOID __stdargs __saveds
  26. DriverExpunge(VOID)
  27. {
  28.     LocaleCleanup();
  29.  
  30.     if(UtilityBase != NULL)
  31.     {
  32.         CloseLibrary(UtilityBase);
  33.         UtilityBase = NULL;
  34.     }
  35. }
  36.  
  37. VOID __stdargs __saveds
  38. DriverInit(struct PrinterData * pd)
  39. {
  40.     SysBase            = AbsExecBase;
  41.     UtilityBase        = OpenLibrary("utility.library",37);
  42.     PED                = &PEDData;
  43.     PD                = pd;
  44.     PWrite            = (PWRITE_T)pd->pd_PWrite;
  45.     PBothReady        = (PBOTHREADY_T)pd->pd_PBothReady;
  46.  
  47.     LocaleSetup();
  48. }
  49.  
  50. VOID __stdargs __saveds
  51. DriverClose(struct printerIO *ior)
  52. {
  53.     /* if data has been printed */
  54.     if(PED->ped_PrintMode)
  55.     {
  56.         (*PWrite)("\014",1);    /* eject page */
  57.         (*PBothReady)();        /* wait for it to finish */
  58.         PED->ped_PrintMode = 0;    /* no data to print */
  59.     }
  60. }
  61.  
  62. LONG __stdargs __saveds
  63. DriverOpen(struct printerIO *ior)
  64. {
  65.     LONG result = ERROR;
  66.  
  67.     if(UtilityBase != NULL && PD->pd_Device.dd_Device.lib_Version >= 44)
  68.         result = OK;
  69.  
  70.     return(result);
  71. }
  72.